package actions.standard.form;

import gui.standard.form.StandardForm;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

public class ZoomFormAction extends AbstractAction {

	private static final long serialVersionUID = 1L;

	private StandardForm standardForm, zoomForm;
	private boolean first = true;

	public ZoomFormAction(StandardForm standardForm, StandardForm zoomForm) {
		putValue(SHORT_DESCRIPTION, "Zoom");
		putValue(NAME, "...");

		this.standardForm = standardForm;
		this.zoomForm = zoomForm;
	}

	@Override
	public void actionPerformed(ActionEvent event) {
		zoomForm.setPickupForm(standardForm);
		if(first){
			zoomForm.init();
			first = false;
		}
		zoomForm.open();
		zoomForm.setVisible(true);
	}

}
